
import { DTaroAjax } from '@/http/http'

const base = '/api/cookcar-pay'

const pay = {
  //app绑定企业银行卡
  appSaveBank(params) {
    return DTaroAjax(`${base}/pay/corporateBankCard/appSaveBank`, params, 'POST')
  },
  //查询企业银行卡列表 平台
  searchBankCard(params) {
    return DTaroAjax(`${base}/pay/corporateBankCard/`, params)
  },
  //查询企业银行卡列表
  searchBankCardAppList() {
    return DTaroAjax(`${base}/pay/corporateBankCard/appList`)
  },
  //修改企业银行卡(解绑)
  corporateBankCard(params) {
    return DTaroAjax(`${base}/pay/corporateBankCard/${params.cbcId}`, params, 'PUT')
  },

  //查询交易退款列表 //获取交易退款信息
  tradingRefund(params, trId) {
    return DTaroAjax(`${base}/pay/tradingRefund/` + (!trId ? 'appList' : '') + (trId || ''), params)
  },
  //app企业银行收入支出明细列表
  appBankInfoList(params) {

    return DTaroAjax(`${base}/pay/corporateBankCard/appBankInfoList?limit=${params.limit}&page=${params.page}&type=${params.type}`, {}, 'POST')
  },
  //app企业银行收入支出明细列表
  appMoneyInfo(params) {

    return DTaroAjax(`${base}/pay/corporateBankCard/appMoneyInfo`, {})
  },
  //支付密钥
  keyInitInit(params) {
    return DTaroAjax(`${base}/keyInit/init`, {}, 'post')
  },
  //支付密钥
  orderIspay(ORDERID) {
    return DTaroAjax(`${base}/pay/isPay?orderNo=${ORDERID}`, {}, 'post')
  },
  //电子登记薄开户
  accountKaihu(params) {
    return DTaroAjax(`${base}/pay/electronicRegister/kaihu`, { ...params }, 'post')
  },
  // 测试点击登记簿开户
  ceshi() {
    return DTaroAjax(`${base}/pay/electronicRegister/ceshi`, {}, 'get')
  },
  // 获取对应企业登记簿信息
  infoByEnterprise() {
    return DTaroAjax(`${base}/pay/electronicRegister/infoByEnterprise`, {}, 'get')
  },
  fileUpload(params) {
    return DTaroAjax(`${base}/pay/electronicRegister/fileUpload`, params, 'get')
  },
  // 单笔交易查询
  singleTransaction(params) {
    return DTaroAjax(`${base}/pay/deal/singleTransaction`, params, 'get')
  },
  // 电子登记簿余额信息查询
  getBalance() {
    return DTaroAjax(`${base}/pay/electronicRegister/balance`, {}, 'get')
  },
  // 更新交易密码
  updataPassword(operType) {
    return DTaroAjax(`${base}/pay/electronicRegister/updataPassword?operType=${operType}`, {}, 'get')
  },
  // 提现
  lcgWithdraw(params) {
    return DTaroAjax(`${base}/pay/lcgWithdraw/`, params, 'post')
  },
  // 提现记录列表
  getWithdrawList() {
    return DTaroAjax(`${base}/pay/lcgWithdraw/getList`, {}, 'get')
  }
}

export default pay
